/*
kunpengsecl licensed under the Mulan PSL v2.
You can use this software according to the terms and conditions of
the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at:
    http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.

Author: gwei3/yemaolin/wanghaijing
Create: 2021-09-17
Description: manage the client trust status.
	1. 2022-01-17	wucaijun
		use cache/database/files three levels arch to implement a simple
		but high performance client trust management algorithm.
	2. 2022-01-28	wucaijun
		modify the mutex lock scope to enhance performance.
	3. 2022-01-30	wucaijun
		add the storeDb for using limited file handle to enhance database performance.
*/

package trustmgr

import (
	"crypto/x509"
	"encoding/json"
	"encoding/pem"
	"fmt"
	"io/ioutil"
	"math/big"
	"net"
	"os"
	"testing"
	"time"

	"gitee.com/openeuler/kunpengsecl/attestation/common/cryptotools"
	"gitee.com/openeuler/kunpengsecl/attestation/common/typdefs"
	"gitee.com/openeuler/kunpengsecl/attestation/ras/config"
	"github.com/stretchr/testify/assert"
)

const (
	constinfo           = `{"ip": "8.8.8.%d", "name": "google DNS", "last": %d}`
	consttimeformat     = "06-01-02-15-04-05"
	constregisterfailed = "register fail %v"
	constPath           = "/reports"
	constDB             = "postgres"
	constDNS            = "user=postgres password=postgres dbname=kunpengsecl host=localhost port=5432 sslmode=disable"
	rootCertFilePath    = "./Huawei IT Product CA.pem"
	testImaLogPath      = "./ascii_runtime_measurements"
	testBiosLogPath     = "./binary_bios_measurements"
	configFilePath      = "./config.yaml"
	BIOSLogPath         = "../../rac/cmd/raagent/binary_bios_measurements"
	IMALogPath          = "../../rac/cmd/raagent/ascii_runtime_measurements"
	Three               = 3
	rasConfig           = `
database:
  host: localhost
  name: kunpengsecl
  password: postgres
  port: 5432
  user: postgres
log:
  file: ./logs/ras-log.txt
racconfig:
  digestalgorithm: sha1
  hbduration: 10s
  trustduration: 2m0s
rasconfig:
  authkeyfile: ./ecdsakey.pub
  pcakeycertfile: ""
  pcaprivkeyfile: ""
  httpsswitch: false
  restport: 127.0.0.1:40002
  httpsport: 127.0.0.1:40003
  rootkeycertfile: ""
  rootprivkeyfile: ""
  mgrstrategy: "auto"
  serialnumber: 0
  serverport: 127.0.0.1:40001
  onlineduration: 30s
  taverifytype: 3
  basevalue-extract-rules:
    manifest:
    - name:
      - 8-0
      - 80000008-1
      type: bios
    - name:
      - boot_aggregate
      - /etc/modprobe.d/tuned.conf
      type: ima
    pcrinfo:
      pcrselection:
      - 1
      - 2
      - 3
      - 4
`
	IKpubPEM = `
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn8CYQqdaTdMxnKp248Fb
UZhxmpSTbb5CA/wUQQ0ARzr0eV3VwzKUhf8mPzkZQDTh36MzGxviBOpk922Gq3Ou
g1OXZ2LG2FPelqQRMvdWY3P/ITzKCoJ+DxlSDAt2zNuXRPnn/TyhXLx8UIAf5Vsx
OjvRxfV/z4r7zcOf33FdI8SuLV3YpNo/pOTJwqv/egV0kxtHDmqI3Vus+KSRjg6g
mlFex7A5TP8axDyLz0nPYP7XLbx1xNQ58VE8Oe51k7qwv8TOE03FVkWkSY25OEH1
2fSx1FasGAEVXVeEugz2W49rLXH4g8DMQ46Q6340J/+oS7+zT1Z0wNDGkqyQD1st
FQIDAQAB
-----END PUBLIC KEY-----`
)

var (
	pcrLogsha1 = `0 : 0x5E08445964409DCE187BE5E5D8546A85CF95A6EA
1 : 0xD261FEA4BDF79D4C41E4395044C54C4B5694A6C5
2 : 0xB2A83B0EBF2F8374299A5B2BDFC31EA955AD7236
3 : 0xB2A83B0EBF2F8374299A5B2BDFC31EA955AD7236
4 : 0x45A323382BD933F08E7F0E256BC8249E4095B1EC
5 : 0xD16D7E629FD8D08CA256F9AD3A3A1587C9E6CC1B
6 : 0xB2A83B0EBF2F8374299A5B2BDFC31EA955AD7236
7 : 0x4037336FA7BC0EABE3778FCFFF5FCD0EE6ADCDE3
8 : 0x0000000000000000000000000000000000000000
9 : 0x0000000000000000000000000000000000000000
10: 0x0000000000000000000000000000000000000000
11: 0x0000000000000000000000000000000000000000
12: 0x0000000000000000000000000000000000000000
13: 0x0000000000000000000000000000000000000000
14: 0x0000000000000000000000000000000000000000
15: 0x0000000000000000000000000000000000000000
16: 0x0000000000000000000000000000000000000000
17: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
18: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
19: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
20: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
21: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
22: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
23: 0x0000000000000000000000000000000000000000`
	pcrLogsha256 = `0 : 0x47F9F24467740A8FE5B157C0B1A79EDBA7E35EE4B3F61329081256C8118891CF
1 : 0x8CECFF7D3B42438BC2808D0DA8A834508C4886C52018AFE825C0E894B3BDE49A
2 : 0x3D458CFE55CC03EA1F443F1562BEEC8DF51C75E14A9FCF9A7234A13F198E7969
3 : 0x3D458CFE55CC03EA1F443F1562BEEC8DF51C75E14A9FCF9A7234A13F198E7969
4 : 0x7A94FFE8A7729A566D3D3C577FCB4B6B1E671F31540375F80EAE6382AB785E35
5 : 0xA5CEB755D043F32431D63E39F5161464620A3437280494B5850DC1B47CC074E0
6 : 0x3D458CFE55CC03EA1F443F1562BEEC8DF51C75E14A9FCF9A7234A13F198E7969
7 : 0xB5710BF57D25623E4019027DA116821FA99F5C81E9E38B87671CC574F9281439
8 : 0x0000000000000000000000000000000000000000000000000000000000000000
9 : 0x0000000000000000000000000000000000000000000000000000000000000000
10: 0x0000000000000000000000000000000000000000000000000000000000000000
11: 0x0000000000000000000000000000000000000000000000000000000000000000
12: 0x0000000000000000000000000000000000000000000000000000000000000000
13: 0x0000000000000000000000000000000000000000000000000000000000000000
14: 0x0000000000000000000000000000000000000000000000000000000000000000
15: 0x0000000000000000000000000000000000000000000000000000000000000000
16: 0x0000000000000000000000000000000000000000000000000000000000000000
17: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
18: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
19: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
20: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
21: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
22: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
23: 0x0000000000000000000000000000000000000000000000000000000000000000`
	biosLog = []byte{
		0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
		0x53, 0x70, 0x65, 0x63, 0x20, 0x49, 0x44, 0x20, 0x45, 0x76, 0x65, 0x6E, 0x74, 0x30, 0x33, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x14, 0x00,
		0x0B, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
		0x00, 0x04, 0x00, 0x53, 0x93, 0x3B, 0xE8, 0x90, 0x80, 0xC1, 0xFD, 0xC6, 0x35, 0x2B, 0xB6, 0xC8,
		0xE7, 0x87, 0x99, 0xD0, 0x1F, 0x23, 0x00, 0x0B, 0x00, 0x77, 0xE4, 0x1E, 0x1A, 0x6E, 0x98, 0xF7,
		0x16, 0x0A, 0x8B, 0xA8, 0x5D, 0x1B, 0x68, 0x1D, 0xF8, 0x4B, 0x74, 0x9F, 0x88, 0xFF, 0xD5, 0x85,
		0x61, 0x2E, 0x14, 0x54, 0x21, 0xB4, 0x2E, 0xE5, 0x81, 0x0A, 0x00, 0x00, 0x00, 0x31, 0x00, 0x2E,
		0x00, 0x30, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80, 0x02,
		0x00, 0x00, 0x00, 0x04, 0x00, 0xC6, 0xDA, 0xAA, 0xF6, 0x6E, 0xFC, 0xE1, 0x2D, 0x87, 0x25, 0x4E,
		0xB5, 0xDC, 0x4B, 0xD2, 0xB8, 0xAD, 0x0D, 0xC0, 0x85, 0x0B, 0x00, 0x72, 0x3E, 0xD4, 0xCF, 0x5A,
		0xCC, 0xF6, 0x5D, 0x8F, 0xE6, 0x84, 0x49, 0x1D, 0x5C, 0xB1, 0xF6, 0x16, 0x7F, 0x63, 0x15, 0xFA,
		0x55, 0x3D, 0x57, 0xFB, 0xF9, 0x46, 0x66, 0x7B, 0x07, 0xC2, 0xAD, 0x10, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x10, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
		0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x2F, 0x20, 0x11,
		0x2A, 0x3F, 0x55, 0x39, 0x8B, 0x20, 0x8E, 0x0C, 0x42, 0x68, 0x13, 0x89, 0xB4, 0xCB, 0x5B, 0x18,
		0x23, 0x0B, 0x00, 0xCE, 0x9C, 0xE3, 0x86, 0xB5, 0x2E, 0x09, 0x9F, 0x30, 0x19, 0xE5, 0x12, 0xA0,
		0xD6, 0x06, 0x2D, 0x6B, 0x56, 0x0E, 0xFE, 0x4F, 0xF3, 0xE5, 0x66, 0x1C, 0x75, 0x25, 0xE2, 0xF9,
		0xC2, 0x63, 0xDF, 0x34, 0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA,
		0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x00, 0x65, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72,
		0x00, 0x65, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01,
		0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x9B, 0x13, 0x87, 0x30, 0x6E, 0xBB, 0x7F,
		0xF8, 0xE7, 0x95, 0xE7, 0xBE, 0x77, 0x56, 0x36, 0x66, 0xBB, 0xF4, 0x51, 0x6E, 0x0B, 0x00, 0xDE,
		0xA7, 0xB8, 0x0A, 0xB5, 0x3A, 0x3D, 0xAA, 0xA2, 0x4D, 0x5C, 0xC4, 0x6C, 0x64, 0xE1, 0xFA, 0x9F,
		0xFD, 0x03, 0x73, 0x9F, 0x90, 0xAA, 0xDB, 0xD8, 0xC0, 0x86, 0x7C, 0x4A, 0x5B, 0x48, 0x90, 0x24,
		0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98,
		0x03, 0x2B, 0x8C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x50, 0x00, 0x4B, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x9A, 0xFA, 0x86, 0xC5, 0x07, 0x41, 0x9B, 0x85, 0x70, 0xC6, 0x21,
		0x67, 0xCB, 0x94, 0x86, 0xD9, 0xFC, 0x80, 0x97, 0x58, 0x0B, 0x00, 0xE6, 0x70, 0xE1, 0x21, 0xFC,
		0xEB, 0xD4, 0x73, 0xB8, 0xBC, 0x41, 0xBB, 0x80, 0x13, 0x01, 0xFC, 0x1D, 0x9A, 0xFA, 0x33, 0x90,
		0x4F, 0x06, 0xF7, 0x14, 0x9B, 0x74, 0xF1, 0x2C, 0x47, 0xA6, 0x8F, 0x26, 0x00, 0x00, 0x00, 0x61,
		0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x03,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B,
		0x00, 0x45, 0x00, 0x4B, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00,
		0x00, 0x04, 0x00, 0x5B, 0xF8, 0xFA, 0xA0, 0x78, 0xD4, 0x0F, 0xFB, 0xD0, 0x33, 0x17, 0xC9, 0x33,
		0x98, 0xB0, 0x12, 0x29, 0xA0, 0xE1, 0xE0, 0x0B, 0x00, 0xBA, 0xF8, 0x9A, 0x3C, 0xCA, 0xCE, 0x52,
		0x75, 0x0C, 0x5F, 0x01, 0x28, 0x35, 0x1E, 0x04, 0x22, 0xA4, 0x15, 0x97, 0xA1, 0xAD, 0xFD, 0x50,
		0x82, 0x2A, 0xA3, 0x63, 0xB9, 0xD1, 0x24, 0xEA, 0x7C, 0x24, 0x00, 0x00, 0x00, 0xCB, 0xB2, 0x19,
		0xD7, 0x3A, 0x3D, 0x96, 0x45, 0xA3, 0xBC, 0xDA, 0xD0, 0x0E, 0x67, 0x65, 0x6F, 0x02, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x62,
		0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x73,
		0x44, 0x24, 0xC9, 0xFE, 0x8F, 0xC7, 0x17, 0x16, 0xC4, 0x20, 0x96, 0xF4, 0xB7, 0x4C, 0x88, 0x73,
		0x3B, 0x17, 0x5E, 0x0B, 0x00, 0x9F, 0x75, 0xB6, 0x82, 0x3B, 0xFF, 0x6A, 0xF1, 0x02, 0x4A, 0x4E,
		0x20, 0x36, 0x71, 0x9C, 0xDD, 0x54, 0x8D, 0x3C, 0xBC, 0x2B, 0xF1, 0xDE, 0x8E, 0x7E, 0xF4, 0xD0,
		0xED, 0x01, 0xF9, 0x4B, 0xF9, 0x26, 0x00, 0x00, 0x00, 0xCB, 0xB2, 0x19, 0xD7, 0x3A, 0x3D, 0x96,
		0x45, 0xA3, 0xBC, 0xDA, 0xD0, 0x0E, 0x67, 0x65, 0x6F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x62, 0x00, 0x78, 0x00, 0x07,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x90, 0x69, 0xCA,
		0x78, 0xE7, 0x45, 0x0A, 0x28, 0x51, 0x73, 0x43, 0x1B, 0x3E, 0x52, 0xC5, 0xC2, 0x52, 0x99, 0xE4,
		0x73, 0x0B, 0x00, 0xDF, 0x3F, 0x61, 0x98, 0x04, 0xA9, 0x2F, 0xDB, 0x40, 0x57, 0x19, 0x2D, 0xC4,
		0x3D, 0xD7, 0x48, 0xEA, 0x77, 0x8A, 0xDC, 0x52, 0xBC, 0x49, 0x8C, 0xE8, 0x05, 0x24, 0xC0, 0x14,
		0xB8, 0x11, 0x19, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,
		0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0xEC, 0x00, 0xB7, 0x39, 0x5A, 0xEC, 0xF2,
		0xFF, 0xC2, 0x61, 0xF8, 0x76, 0x59, 0x73, 0xC1, 0xF4, 0x4E, 0x78, 0x4D, 0xF7, 0x0B, 0x00, 0xB3,
		0x77, 0x71, 0x2B, 0x29, 0x67, 0x34, 0x6E, 0xEF, 0x0A, 0x3A, 0x0E, 0x3C, 0x6B, 0x22, 0xE6, 0x96,
		0x93, 0xD1, 0x71, 0xF0, 0x03, 0x1F, 0xA6, 0x47, 0x9D, 0x5C, 0x5C, 0x91, 0x08, 0x67, 0xAE, 0x4C,
		0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98,
		0x03, 0x2B, 0x8C, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x4F, 0x00, 0x72, 0x00, 0x64,
		0x00, 0x65, 0x00, 0x72, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x0F, 0x00, 0x11, 0x00, 0x13, 0x00, 0x1C,
		0x00, 0x1E, 0x00, 0x20, 0x00, 0x22, 0x00, 0x05, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
		0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x56, 0x31, 0x41,
		0x58, 0x2B, 0x98, 0xF0, 0x84, 0x07, 0x86, 0x87, 0xCA, 0xCB, 0x60, 0x5E, 0x28, 0xAA, 0xCE, 0x3D,
		0xD7, 0x0B, 0x00, 0x8E, 0x70, 0x6B, 0x35, 0xD3, 0x93, 0xFF, 0x85, 0x07, 0x10, 0x3B, 0xB4, 0x30,
		0x76, 0xCC, 0x17, 0x83, 0x96, 0xD6, 0x52, 0xEE, 0xD0, 0x5F, 0xB3, 0x32, 0x8E, 0x64, 0x0B, 0x15,
		0x69, 0x39, 0xE0, 0xD0, 0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA,
		0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30,
		0x00, 0x30, 0x00, 0x30, 0x00, 0x34, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8C, 0x00, 0x75, 0x00, 0x62,
		0x00, 0x75, 0x00, 0x6E, 0x00, 0x74, 0x00, 0x75, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0C, 0x00, 0xD0,
		0x41, 0x03, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00, 0x08, 0x01, 0x01, 0x06,
		0x00, 0x00, 0x00, 0x01, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x08, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x04, 0x01, 0x2A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0xFA, 0xF6, 0xF1, 0x66,
		0x4A, 0x43, 0x4B, 0xBC, 0x3F, 0x9E, 0x9B, 0xC6, 0xA6, 0xA5, 0x6D, 0x02, 0x02, 0x04, 0x04, 0x36,
		0x00, 0x5C, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49, 0x00, 0x5C, 0x00, 0x75, 0x00, 0x62, 0x00, 0x75,
		0x00, 0x6E, 0x00, 0x74, 0x00, 0x75, 0x00, 0x5C, 0x00, 0x67, 0x00, 0x72, 0x00, 0x75, 0x00, 0x62,
		0x00, 0x61, 0x00, 0x61, 0x00, 0x36, 0x00, 0x34, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x66, 0x00, 0x69,
		0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x42, 0x5D, 0xE9, 0xFC, 0xA5, 0x19, 0x5A, 0xD9, 0xE7, 0x26, 0xAC,
		0x3C, 0x2A, 0x33, 0x53, 0x3C, 0xF3, 0x64, 0xF6, 0x48, 0x0B, 0x00, 0x78, 0x87, 0x41, 0x52, 0x4C,
		0x67, 0x46, 0xC7, 0x0A, 0xBC, 0xE0, 0xBF, 0x34, 0x20, 0x24, 0x97, 0x18, 0x37, 0xF5, 0x60, 0x11,
		0x7E, 0xC1, 0xA2, 0x49, 0x29, 0xB1, 0xE4, 0xD6, 0x44, 0x09, 0xD3, 0xDE, 0x00, 0x00, 0x00, 0x61,
		0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42,
		0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x44, 0x00, 0x01,
		0x00, 0x00, 0x00, 0x5C, 0x00, 0x55, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49, 0x00, 0x20, 0x00, 0x50,
		0x00, 0x58, 0x00, 0x45, 0x00, 0x76, 0x00, 0x34, 0x00, 0x20, 0x00, 0x28, 0x00, 0x4D, 0x00, 0x41,
		0x00, 0x43, 0x00, 0x3A, 0x00, 0x41, 0x00, 0x43, 0x00, 0x38, 0x00, 0x44, 0x00, 0x33, 0x00, 0x34,
		0x00, 0x43, 0x00, 0x37, 0x00, 0x39, 0x00, 0x32, 0x00, 0x36, 0x00, 0x45, 0x00, 0x29, 0x00, 0x00,
		0x00, 0x02, 0x01, 0x0C, 0x00, 0xD0, 0x41, 0x03, 0x0A, 0x04, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06,
		0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x03, 0x0B, 0x25, 0x00, 0xAC, 0x8D, 0x34,
		0xC7, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0C,
		0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, 0x4E, 0xAC, 0x08,
		0x81, 0x11, 0x9F, 0x59, 0x4D, 0x85, 0x0E, 0xE2, 0x1A, 0x52, 0x2C, 0x59, 0xB2, 0x01, 0x00, 0x00,
		0x00, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x34, 0x79, 0x65, 0x81, 0xB8,
		0x96, 0x50, 0x14, 0xD1, 0x81, 0xFA, 0x16, 0xAB, 0x44, 0x88, 0x97, 0xA2, 0xA4, 0x85, 0x7E, 0x0B,
		0x00, 0x13, 0x71, 0x7A, 0x26, 0x65, 0x06, 0xC0, 0x6D, 0xDC, 0x63, 0x7D, 0x15, 0x5B, 0x05, 0x3C,
		0xBD, 0x71, 0x8E, 0x27, 0xBE, 0x11, 0x59, 0x2D, 0x83, 0x8D, 0x00, 0xD3, 0x83, 0x9A, 0x6B, 0x05,
		0xB2, 0xDE, 0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00,
		0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAE, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30,
		0x00, 0x30, 0x00, 0x46, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x55, 0x00, 0x45, 0x00, 0x46,
		0x00, 0x49, 0x00, 0x20, 0x00, 0x50, 0x00, 0x58, 0x00, 0x45, 0x00, 0x76, 0x00, 0x34, 0x00, 0x20,
		0x00, 0x28, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x43, 0x00, 0x3A, 0x00, 0x41, 0x00, 0x43, 0x00, 0x38,
		0x00, 0x44, 0x00, 0x33, 0x00, 0x34, 0x00, 0x43, 0x00, 0x37, 0x00, 0x39, 0x00, 0x32, 0x00, 0x36,
		0x00, 0x46, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0C, 0x00, 0xD0, 0x41, 0x03, 0x0A, 0x04,
		0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x01, 0x00, 0x03,
		0x0B, 0x25, 0x00, 0xAC, 0x8D, 0x34, 0xC7, 0x92, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x01, 0x03, 0x0C, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F,
		0xFF, 0x04, 0x00, 0x4E, 0xAC, 0x08, 0x81, 0x11, 0x9F, 0x59, 0x4D, 0x85, 0x0E, 0xE2, 0x1A, 0x52,
		0x2C, 0x59, 0xB2, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04,
		0x00, 0xB5, 0x03, 0x00, 0xE5, 0x18, 0xD2, 0xEF, 0x4C, 0xC7, 0x5E, 0x9B, 0x3F, 0x0E, 0xAA, 0xF0,
		0x79, 0xD8, 0x41, 0x36, 0x69, 0x0B, 0x00, 0xFF, 0x52, 0x7D, 0x53, 0x9E, 0x5C, 0x2A, 0x20, 0xA5,
		0x79, 0x39, 0xDB, 0x5A, 0x2E, 0x95, 0xA3, 0x78, 0xE2, 0x42, 0xB6, 0xE6, 0xBF, 0x98, 0xDF, 0x33,
		0x7B, 0x49, 0xE1, 0x76, 0x3A, 0x83, 0xE1, 0xDE, 0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA,
		0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F,
		0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, 0x31, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5C,
		0x00, 0x55, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49, 0x00, 0x20, 0x00, 0x50, 0x00, 0x58, 0x00, 0x45,
		0x00, 0x76, 0x00, 0x34, 0x00, 0x20, 0x00, 0x28, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x43, 0x00, 0x3A,
		0x00, 0x41, 0x00, 0x43, 0x00, 0x38, 0x00, 0x44, 0x00, 0x33, 0x00, 0x34, 0x00, 0x43, 0x00, 0x37,
		0x00, 0x39, 0x00, 0x32, 0x00, 0x37, 0x00, 0x30, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0C,
		0x00, 0xD0, 0x41, 0x03, 0x0A, 0x04, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x01,
		0x01, 0x06, 0x00, 0x02, 0x00, 0x03, 0x0B, 0x25, 0x00, 0xAC, 0x8D, 0x34, 0xC7, 0x92, 0x70, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0C, 0x1B, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, 0x4E, 0xAC, 0x08, 0x81, 0x11, 0x9F, 0x59,
		0x4D, 0x85, 0x0E, 0xE2, 0x1A, 0x52, 0x2C, 0x59, 0xB2, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
		0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0xE4, 0x94, 0x1A, 0xF3, 0xD5, 0x31, 0x0A, 0xDF, 0xC6,
		0x13, 0xA6, 0x2B, 0x20, 0x49, 0x9E, 0xD3, 0xF8, 0x62, 0x5B, 0xF3, 0x0B, 0x00, 0xC6, 0x3C, 0xAB,
		0x1B, 0x58, 0x3F, 0x99, 0x9C, 0x47, 0x06, 0x85, 0x49, 0x85, 0x93, 0x15, 0xD9, 0x4D, 0xA7, 0xEA,
		0xE0, 0x72, 0xB6, 0xF4, 0xDD, 0x5C, 0x13, 0x27, 0xCC, 0x2D, 0x5F, 0xD2, 0x89, 0xDE, 0x00, 0x00,
		0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B,
		0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, 0x33,
		0x00, 0x01, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x55, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49, 0x00, 0x20,
		0x00, 0x50, 0x00, 0x58, 0x00, 0x45, 0x00, 0x76, 0x00, 0x34, 0x00, 0x20, 0x00, 0x28, 0x00, 0x4D,
		0x00, 0x41, 0x00, 0x43, 0x00, 0x3A, 0x00, 0x41, 0x00, 0x43, 0x00, 0x38, 0x00, 0x44, 0x00, 0x33,
		0x00, 0x34, 0x00, 0x43, 0x00, 0x37, 0x00, 0x39, 0x00, 0x32, 0x00, 0x37, 0x00, 0x31, 0x00, 0x29,
		0x00, 0x00, 0x00, 0x02, 0x01, 0x0C, 0x00, 0xD0, 0x41, 0x03, 0x0A, 0x04, 0x00, 0x00, 0x00, 0x01,
		0x01, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x03, 0x00, 0x03, 0x0B, 0x25, 0x00, 0xAC,
		0x8D, 0x34, 0xC7, 0x92, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
		0x03, 0x0C, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, 0x4E,
		0xAC, 0x08, 0x81, 0x11, 0x9F, 0x59, 0x4D, 0x85, 0x0E, 0xE2, 0x1A, 0x52, 0x2C, 0x59, 0xB2, 0x01,
		0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x57, 0x28, 0xD2,
		0x62, 0x1A, 0xC0, 0xDD, 0xE7, 0x67, 0xDF, 0xE1, 0x7A, 0x00, 0x25, 0xAC, 0xD1, 0x51, 0x93, 0x39,
		0xE9, 0x0B, 0x00, 0xFA, 0x7C, 0x8C, 0xE8, 0x24, 0xE4, 0xCE, 0x9B, 0x8A, 0x7E, 0x5B, 0x77, 0xB6,
		0x00, 0x76, 0xC1, 0x1D, 0x70, 0xB7, 0x56, 0x93, 0x9B, 0x0C, 0xB8, 0x07, 0x93, 0xC4, 0x1E, 0x47,
		0xC2, 0xE3, 0x3C, 0xDE, 0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA,
		0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAE,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30,
		0x00, 0x30, 0x00, 0x31, 0x00, 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x55, 0x00, 0x45,
		0x00, 0x46, 0x00, 0x49, 0x00, 0x20, 0x00, 0x50, 0x00, 0x58, 0x00, 0x45, 0x00, 0x76, 0x00, 0x34,
		0x00, 0x20, 0x00, 0x28, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x43, 0x00, 0x3A, 0x00, 0x41, 0x00, 0x43,
		0x00, 0x38, 0x00, 0x44, 0x00, 0x33, 0x00, 0x34, 0x00, 0x43, 0x00, 0x37, 0x00, 0x39, 0x00, 0x32,
		0x00, 0x37, 0x00, 0x32, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0C, 0x00, 0xD0, 0x41, 0x03,
		0x0A, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00,
		0x00, 0x03, 0x0B, 0x25, 0x00, 0xAC, 0x8D, 0x34, 0xC7, 0x92, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0C, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x7F, 0xFF, 0x04, 0x00, 0x4E, 0xAC, 0x08, 0x81, 0x11, 0x9F, 0x59, 0x4D, 0x85, 0x0E, 0xE2,
		0x1A, 0x52, 0x2C, 0x59, 0xB2, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00,
		0x00, 0x04, 0x00, 0x4C, 0xE7, 0xED, 0x09, 0x4B, 0xED, 0xE8, 0x5E, 0xE6, 0x97, 0x1D, 0x35, 0x8F,
		0xBC, 0x86, 0x65, 0x64, 0x91, 0x7D, 0x4A, 0x0B, 0x00, 0x8D, 0x06, 0x4D, 0xA9, 0x67, 0x61, 0x01,
		0x56, 0xD8, 0xC1, 0xD5, 0xEE, 0xDE, 0x0A, 0x20, 0x97, 0xFB, 0x32, 0x11, 0x03, 0x7A, 0xD6, 0x80,
		0x6B, 0x85, 0x1F, 0x8D, 0xBE, 0x0C, 0xCB, 0xD9, 0xAC, 0xDE, 0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4,
		0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x6F,
		0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, 0x45, 0x00, 0x01, 0x00, 0x00,
		0x00, 0x5C, 0x00, 0x55, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49, 0x00, 0x20, 0x00, 0x50, 0x00, 0x58,
		0x00, 0x45, 0x00, 0x76, 0x00, 0x34, 0x00, 0x20, 0x00, 0x28, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x43,
		0x00, 0x3A, 0x00, 0x41, 0x00, 0x43, 0x00, 0x38, 0x00, 0x44, 0x00, 0x33, 0x00, 0x34, 0x00, 0x43,
		0x00, 0x37, 0x00, 0x39, 0x00, 0x32, 0x00, 0x37, 0x00, 0x33, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02,
		0x01, 0x0C, 0x00, 0xD0, 0x41, 0x03, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00,
		0x00, 0x01, 0x01, 0x06, 0x00, 0x01, 0x00, 0x03, 0x0B, 0x25, 0x00, 0xAC, 0x8D, 0x34, 0xC7, 0x92,
		0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0C, 0x1B, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, 0x4E, 0xAC, 0x08, 0x81, 0x11,
		0x9F, 0x59, 0x4D, 0x85, 0x0E, 0xE2, 0x1A, 0x52, 0x2C, 0x59, 0xB2, 0x01, 0x00, 0x00, 0x00, 0x02,
		0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x4D, 0x76, 0xAB, 0x77, 0x3F, 0x7B, 0x22,
		0x08, 0x8E, 0x00, 0x07, 0xBB, 0xAF, 0xFC, 0x40, 0x9C, 0x7B, 0x3B, 0xE0, 0x53, 0x0B, 0x00, 0x6C,
		0x6B, 0xA1, 0xBF, 0x50, 0x93, 0xCA, 0x76, 0xFB, 0x5F, 0xCE, 0x82, 0xA1, 0x7B, 0x8F, 0xCA, 0xAD,
		0xE4, 0x1D, 0xD1, 0x5C, 0x08, 0x41, 0x6D, 0x21, 0xA9, 0xB7, 0x05, 0xF7, 0x34, 0xAA, 0x17, 0xDE,
		0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98,
		0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x32,
		0x00, 0x30, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x55, 0x00, 0x45, 0x00, 0x46, 0x00, 0x49,
		0x00, 0x20, 0x00, 0x50, 0x00, 0x58, 0x00, 0x45, 0x00, 0x76, 0x00, 0x34, 0x00, 0x20, 0x00, 0x28,
		0x00, 0x4D, 0x00, 0x41, 0x00, 0x43, 0x00, 0x3A, 0x00, 0x41, 0x00, 0x43, 0x00, 0x38, 0x00, 0x44,
		0x00, 0x33, 0x00, 0x34, 0x00, 0x43, 0x00, 0x37, 0x00, 0x39, 0x00, 0x32, 0x00, 0x37, 0x00, 0x34,
		0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0C, 0x00, 0xD0, 0x41, 0x03, 0x0A, 0x0A, 0x00, 0x00,
		0x00, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x02, 0x00, 0x03, 0x0B, 0x25,
		0x00, 0xAC, 0x8D, 0x34, 0xC7, 0x92, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x01, 0x03, 0x0C, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04,
		0x00, 0x4E, 0xAC, 0x08, 0x81, 0x11, 0x9F, 0x59, 0x4D, 0x85, 0x0E, 0xE2, 0x1A, 0x52, 0x2C, 0x59,
		0xB2, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0xAC,
		0xB5, 0xC8, 0x16, 0x9A, 0x72, 0x86, 0xB2, 0x66, 0x2A, 0x23, 0xE3, 0x95, 0xE6, 0x87, 0x2C, 0xE0,
		0x67, 0x2E, 0xF5, 0x0B, 0x00, 0x3F, 0x13, 0x4F, 0x8D, 0x44, 0xD7, 0xCF, 0x35, 0xA5, 0x97, 0x50,
		0xF3, 0x02, 0xDD, 0x3C, 0xF3, 0xEE, 0x80, 0x53, 0x1B, 0x55, 0x67, 0xCA, 0x11, 0xD3, 0x8E, 0xCE,
		0xFA, 0xD1, 0x4B, 0x00, 0xD1, 0xDE, 0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2,
		0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74,
		0x00, 0x30, 0x00, 0x30, 0x00, 0x32, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x55,
		0x00, 0x45, 0x00, 0x46, 0x00, 0x49, 0x00, 0x20, 0x00, 0x50, 0x00, 0x58, 0x00, 0x45, 0x00, 0x76,
		0x00, 0x34, 0x00, 0x20, 0x00, 0x28, 0x00, 0x4D, 0x00, 0x41, 0x00, 0x43, 0x00, 0x3A, 0x00, 0x41,
		0x00, 0x43, 0x00, 0x38, 0x00, 0x44, 0x00, 0x33, 0x00, 0x34, 0x00, 0x43, 0x00, 0x37, 0x00, 0x39,
		0x00, 0x32, 0x00, 0x37, 0x00, 0x35, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0C, 0x00, 0xD0,
		0x41, 0x03, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x06,
		0x00, 0x03, 0x00, 0x03, 0x0B, 0x25, 0x00, 0xAC, 0x8D, 0x34, 0xC7, 0x92, 0x75, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0C, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00, 0x4E, 0xAC, 0x08, 0x81, 0x11, 0x9F, 0x59, 0x4D, 0x85,
		0x0E, 0xE2, 0x1A, 0x52, 0x2C, 0x59, 0xB2, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x70, 0x9C, 0x01, 0x56, 0xE2, 0xC8, 0xC8, 0x4D, 0x9E, 0x78, 0x26,
		0x41, 0xC1, 0x17, 0x98, 0xFE, 0xD3, 0xC7, 0x03, 0x8C, 0x0B, 0x00, 0x18, 0xD3, 0x29, 0xCC, 0x25,
		0x77, 0x85, 0xE8, 0x60, 0xB4, 0xDA, 0xBE, 0x29, 0xEB, 0x33, 0xD8, 0x9C, 0xAC, 0x86, 0xAB, 0x1D,
		0x7C, 0x10, 0xCA, 0x20, 0xE7, 0xCF, 0xB7, 0x76, 0xCC, 0x6B, 0xA6, 0x78, 0x00, 0x00, 0x00, 0x61,
		0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42,
		0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x35, 0x00, 0x09,
		0x01, 0x00, 0x00, 0x30, 0x00, 0x42, 0x00, 0x79, 0x00, 0x6F, 0x00, 0x55, 0x00, 0x69, 0x00, 0x41,
		0x00, 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
		0xC0, 0x0E, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x55, 0xBB, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x04,
		0x06, 0x14, 0x00, 0x4A, 0xC0, 0xC9, 0xD0, 0x96, 0xE7, 0x48, 0x4C, 0x9D, 0x52, 0x9E, 0x0C, 0xED,
		0x39, 0x4F, 0x4B, 0x7F, 0xFF, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x80, 0x02,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x1C, 0x38, 0xC2, 0xC5, 0x8C, 0x4A, 0x38, 0xEB, 0x49, 0xA9, 0x18,
		0xDB, 0xBB, 0x04, 0xA7, 0x5C, 0xE3, 0x52, 0x38, 0xE6, 0x0B, 0x00, 0x32, 0x65, 0x31, 0x02, 0x67,
		0xAB, 0xFB, 0x63, 0x76, 0x85, 0xC3, 0x8D, 0x54, 0x34, 0xED, 0xCB, 0x31, 0xB9, 0xCA, 0xBA, 0xE2,
		0x09, 0x81, 0xB3, 0x98, 0x88, 0xE5, 0xB0, 0x21, 0x5C, 0xEB, 0x63, 0x8C, 0x00, 0x00, 0x00, 0x61,
		0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C, 0x08,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42,
		0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x33, 0x00, 0x09,
		0x01, 0x00, 0x00, 0x30, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x4D, 0x00, 0x61,
		0x00, 0x6E, 0x00, 0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x72, 0x00, 0x4D, 0x00, 0x65, 0x00, 0x6E,
		0x00, 0x75, 0x00, 0x41, 0x00, 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x03, 0x18, 0x00, 0x0B,
		0x00, 0x00, 0x00, 0x00, 0xC0, 0x0E, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x55, 0xBB, 0x3F, 0x00,
		0x00, 0x00, 0x00, 0x04, 0x06, 0x14, 0x00, 0xDC, 0x5B, 0xC2, 0xEE, 0xF2, 0x67, 0x95, 0x4D, 0xB1,
		0xD5, 0xF8, 0x1B, 0x20, 0x39, 0xD1, 0x1D, 0x7F, 0xFF, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,
		0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x7F, 0x6C, 0x23, 0x20, 0xDA, 0x73, 0x49,
		0x81, 0x3B, 0x8A, 0x01, 0xDE, 0x7F, 0xB9, 0x36, 0x3A, 0x9E, 0x52, 0xD9, 0x97, 0x0B, 0x00, 0x6A,
		0x79, 0x2C, 0xCE, 0x63, 0x15, 0xE3, 0xAB, 0x43, 0x75, 0x05, 0xBA, 0x4A, 0xBF, 0xC6, 0xA6, 0x4A,
		0x5F, 0xF3, 0x7A, 0x68, 0x01, 0x3C, 0xD9, 0x76, 0x72, 0xD0, 0xE7, 0x73, 0x0D, 0xDF, 0xB3, 0x78,
		0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98,
		0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30,
		0x00, 0x31, 0x00, 0x09, 0x01, 0x00, 0x00, 0x30, 0x00, 0x42, 0x00, 0x79, 0x00, 0x6F, 0x00, 0x55,
		0x00, 0x69, 0x00, 0x41, 0x00, 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x03, 0x18, 0x00, 0x0B,
		0x00, 0x00, 0x00, 0x00, 0xD0, 0x0D, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x65, 0xBA, 0x3F, 0x00,
		0x00, 0x00, 0x00, 0x04, 0x06, 0x14, 0x00, 0x4A, 0xC0, 0xC9, 0xD0, 0x96, 0xE7, 0x48, 0x4C, 0x9D,
		0x52, 0x9E, 0x0C, 0xED, 0x39, 0x4F, 0x4B, 0x7F, 0xFF, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,
		0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x1B, 0xE8, 0x84, 0xE0, 0xD3, 0x60, 0xF9,
		0x85, 0xAD, 0xB6, 0x12, 0x8D, 0x50, 0x65, 0xF8, 0x0F, 0x24, 0xAE, 0xC0, 0xCC, 0x0B, 0x00, 0x92,
		0x87, 0x38, 0xFD, 0x06, 0x43, 0x39, 0x3C, 0xA4, 0x31, 0xE4, 0xFF, 0xF6, 0xEE, 0xA8, 0x48, 0x5B,
		0x03, 0x28, 0x4F, 0xAB, 0xF0, 0x17, 0x6C, 0x3E, 0xC3, 0x22, 0x57, 0xFE, 0xD5, 0xA0, 0xA2, 0x8C,
		0x00, 0x00, 0x00, 0x61, 0xDF, 0xE4, 0x8B, 0xCA, 0x93, 0xD2, 0x11, 0xAA, 0x0D, 0x00, 0xE0, 0x98,
		0x03, 0x2B, 0x8C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30,
		0x00, 0x30, 0x00, 0x09, 0x01, 0x00, 0x00, 0x30, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74,
		0x00, 0x4D, 0x00, 0x61, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x72, 0x00, 0x4D,
		0x00, 0x65, 0x00, 0x6E, 0x00, 0x75, 0x00, 0x41, 0x00, 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01,
		0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x0D, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFF,
		0x65, 0xBA, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x04, 0x06, 0x14, 0x00, 0xDC, 0x5B, 0xC2, 0xEE, 0xF2,
		0x67, 0x95, 0x4D, 0xB1, 0xD5, 0xF8, 0x1B, 0x20, 0x39, 0xD1, 0x1D, 0x7F, 0xFF, 0x04, 0x00, 0x04,
		0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0xCD, 0x0F, 0xDB,
		0x45, 0x31, 0xA6, 0xEC, 0x41, 0xBE, 0x27, 0x53, 0xBA, 0x04, 0x26, 0x37, 0xD6, 0xE5, 0xF7, 0xF2,
		0x56, 0x0B, 0x00, 0x3D, 0x67, 0x72, 0xB4, 0xF8, 0x4E, 0xD4, 0x75, 0x95, 0xD7, 0x2A, 0x2C, 0x4C,
		0x5F, 0xFD, 0x15, 0xF5, 0xBB, 0x72, 0xC7, 0x50, 0x7F, 0xE2, 0x6F, 0x2A, 0xAE, 0xE2, 0xC6, 0x9D,
		0x56, 0x33, 0xBA, 0x28, 0x00, 0x00, 0x00, 0x43, 0x61, 0x6C, 0x6C, 0x69, 0x6E, 0x67, 0x20, 0x45,
		0x46, 0x49, 0x20, 0x41, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66,
		0x72, 0x6F, 0x6D, 0x20, 0x42, 0x6F, 0x6F, 0x74, 0x20, 0x4F, 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x00,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x90, 0x69, 0xCA,
		0x78, 0xE7, 0x45, 0x0A, 0x28, 0x51, 0x73, 0x43, 0x1B, 0x3E, 0x52, 0xC5, 0xC2, 0x52, 0x99, 0xE4,
		0x73, 0x0B, 0x00, 0xDF, 0x3F, 0x61, 0x98, 0x04, 0xA9, 0x2F, 0xDB, 0x40, 0x57, 0x19, 0x2D, 0xC4,
		0x3D, 0xD7, 0x48, 0xEA, 0x77, 0x8A, 0xDC, 0x52, 0xBC, 0x49, 0x8C, 0xE8, 0x05, 0x24, 0xC0, 0x14,
		0xB8, 0x11, 0x19, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04,
		0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x90, 0x69, 0xCA, 0x78, 0xE7, 0x45, 0x0A,
		0x28, 0x51, 0x73, 0x43, 0x1B, 0x3E, 0x52, 0xC5, 0xC2, 0x52, 0x99, 0xE4, 0x73, 0x0B, 0x00, 0xDF,
		0x3F, 0x61, 0x98, 0x04, 0xA9, 0x2F, 0xDB, 0x40, 0x57, 0x19, 0x2D, 0xC4, 0x3D, 0xD7, 0x48, 0xEA,
		0x77, 0x8A, 0xDC, 0x52, 0xBC, 0x49, 0x8C, 0xE8, 0x05, 0x24, 0xC0, 0x14, 0xB8, 0x11, 0x19, 0x04,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x90, 0x69, 0xCA, 0x78, 0xE7, 0x45, 0x0A, 0x28, 0x51, 0x73, 0x43,
		0x1B, 0x3E, 0x52, 0xC5, 0xC2, 0x52, 0x99, 0xE4, 0x73, 0x0B, 0x00, 0xDF, 0x3F, 0x61, 0x98, 0x04,
		0xA9, 0x2F, 0xDB, 0x40, 0x57, 0x19, 0x2D, 0xC4, 0x3D, 0xD7, 0x48, 0xEA, 0x77, 0x8A, 0xDC, 0x52,
		0xBC, 0x49, 0x8C, 0xE8, 0x05, 0x24, 0xC0, 0x14, 0xB8, 0x11, 0x19, 0x04, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04,
		0x00, 0x90, 0x69, 0xCA, 0x78, 0xE7, 0x45, 0x0A, 0x28, 0x51, 0x73, 0x43, 0x1B, 0x3E, 0x52, 0xC5,
		0xC2, 0x52, 0x99, 0xE4, 0x73, 0x0B, 0x00, 0xDF, 0x3F, 0x61, 0x98, 0x04, 0xA9, 0x2F, 0xDB, 0x40,
		0x57, 0x19, 0x2D, 0xC4, 0x3D, 0xD7, 0x48, 0xEA, 0x77, 0x8A, 0xDC, 0x52, 0xBC, 0x49, 0x8C, 0xE8,
		0x05, 0x24, 0xC0, 0x14, 0xB8, 0x11, 0x19, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x90, 0x69, 0xCA,
		0x78, 0xE7, 0x45, 0x0A, 0x28, 0x51, 0x73, 0x43, 0x1B, 0x3E, 0x52, 0xC5, 0xC2, 0x52, 0x99, 0xE4,
		0x73, 0x0B, 0x00, 0xDF, 0x3F, 0x61, 0x98, 0x04, 0xA9, 0x2F, 0xDB, 0x40, 0x57, 0x19, 0x2D, 0xC4,
		0x3D, 0xD7, 0x48, 0xEA, 0x77, 0x8A, 0xDC, 0x52, 0xBC, 0x49, 0x8C, 0xE8, 0x05, 0x24, 0xC0, 0x14,
		0xB8, 0x11, 0x19, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04,
		0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x90, 0x69, 0xCA, 0x78, 0xE7, 0x45, 0x0A,
		0x28, 0x51, 0x73, 0x43, 0x1B, 0x3E, 0x52, 0xC5, 0xC2, 0x52, 0x99, 0xE4, 0x73, 0x0B, 0x00, 0xDF,
		0x3F, 0x61, 0x98, 0x04, 0xA9, 0x2F, 0xDB, 0x40, 0x57, 0x19, 0x2D, 0xC4, 0x3D, 0xD7, 0x48, 0xEA,
		0x77, 0x8A, 0xDC, 0x52, 0xBC, 0x49, 0x8C, 0xE8, 0x05, 0x24, 0xC0, 0x14, 0xB8, 0x11, 0x19, 0x04,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02,
		0x00, 0x00, 0x00, 0x04, 0x00, 0x90, 0x69, 0xCA, 0x78, 0xE7, 0x45, 0x0A, 0x28, 0x51, 0x73, 0x43,
		0x1B, 0x3E, 0x52, 0xC5, 0xC2, 0x52, 0x99, 0xE4, 0x73, 0x0B, 0x00, 0xDF, 0x3F, 0x61, 0x98, 0x04,
		0xA9, 0x2F, 0xDB, 0x40, 0x57, 0x19, 0x2D, 0xC4, 0x3D, 0xD7, 0x48, 0xEA, 0x77, 0x8A, 0xDC, 0x52,
		0xBC, 0x49, 0x8C, 0xE8, 0x05, 0x24, 0xC0, 0x14, 0xB8, 0x11, 0x19, 0x04, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04,
		0x00, 0x44, 0x3A, 0x6B, 0x7B, 0x82, 0xB7, 0xAF, 0x56, 0x4F, 0x2E, 0x39, 0x3C, 0xD9, 0xD5, 0xA3,
		0x88, 0xB7, 0xFA, 0x4A, 0x98, 0x0B, 0x00, 0xD8, 0x04, 0x3D, 0x6B, 0x7B, 0x85, 0xAD, 0x35, 0x8E,
		0xB3, 0xB6, 0xAE, 0x6A, 0x87, 0x3A, 0xB7, 0xEF, 0x23, 0xA2, 0x63, 0x52, 0xC5, 0xDC, 0x4F, 0xAA,
		0x5A, 0xEE, 0xDA, 0xCF, 0x5E, 0xB4, 0x1B, 0x1D, 0x00, 0x00, 0x00, 0x45, 0x78, 0x69, 0x74, 0x20,
		0x42, 0x6F, 0x6F, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x49, 0x6E,
		0x76, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x80,
		0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x47, 0x55, 0x45, 0xDD, 0xC9, 0x78, 0xD7, 0xBF, 0xD0, 0x36,
		0xFA, 0xCC, 0x7E, 0x2E, 0x98, 0x7F, 0x48, 0x18, 0x9F, 0x0D, 0x0B, 0x00, 0xB5, 0x4F, 0x75, 0x42,
		0xCB, 0xD8, 0x72, 0xA8, 0x1A, 0x9D, 0x9D, 0xEA, 0x83, 0x9B, 0x2B, 0x8D, 0x74, 0x7C, 0x7E, 0xBD,
		0x5E, 0xA6, 0x61, 0x5C, 0x40, 0xF4, 0x2F, 0x44, 0xA6, 0xDB, 0xEB, 0xA0, 0x28, 0x00, 0x00, 0x00,
		0x45, 0x78, 0x69, 0x74, 0x20, 0x42, 0x6F, 0x6F, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
		0x65, 0x73, 0x20, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6E, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68,
		0x20, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
	}
	testquote = []byte{
		0xff, 0x54, 0x43, 0x47, 0x80, 0x18, 0x00, 0x22, 0x00, 0x0b, 0x12, 0x66, 0xfc, 0x6a, 0x0d, 0xdf, 0x97,
		0xb2, 0x9d, 0x01, 0x5d, 0xa0, 0xba, 0x65, 0x88, 0x02, 0x46, 0xfd, 0x6a, 0x6c, 0x07, 0xd4, 0x9f, 0x4a,
		0xd2, 0x15, 0xd8, 0x4c, 0x77, 0xf2, 0x74, 0x5d, 0x00, 0x20, 0x8f, 0xf2, 0x28, 0xf1, 0xbe, 0xe4, 0x63,
		0x0f, 0x6d, 0xe3, 0x52, 0xf0, 0xa0, 0x17, 0x8d, 0xc8, 0xd4, 0x48, 0x15, 0x06, 0xc1, 0x67, 0x51, 0xcd,
		0x50, 0x36, 0x87, 0xa5, 0x5f, 0xcf, 0xb8, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00,
		0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x20, 0x17, 0x06, 0x19, 0x00, 0x16, 0x36, 0x36, 0x00,
		0x00, 0x00, 0x01, 0x00, 0x04, 0x03, 0xff, 0xff, 0xff, 0x00, 0x20, 0x3f, 0x27, 0x08, 0x3e, 0x20, 0xdb,
		0x7c, 0x0b, 0xf0, 0xe3, 0x16, 0x21, 0x19, 0x00, 0xa9, 0x0a, 0x53, 0xe9, 0x9e, 0xf1, 0x2a, 0x68, 0x62,
		0x2e, 0x89, 0x79, 0x27, 0x93, 0x59, 0x88, 0x03, 0xd2}
	testsignature = []byte{
		0x7b, 0x22, 0x41, 0x6c, 0x67, 0x22, 0x3a, 0x32, 0x30, 0x2c, 0x22, 0x52, 0x53, 0x41, 0x22, 0x3a, 0x7b,
		0x22, 0x48, 0x61, 0x73, 0x68, 0x41, 0x6c, 0x67, 0x22, 0x3a, 0x31, 0x31, 0x2c, 0x22, 0x53, 0x69, 0x67,
		0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x3a, 0x22, 0x47, 0x67, 0x30, 0x70, 0x78, 0x32, 0x47, 0x66,
		0x73, 0x38, 0x56, 0x32, 0x2b, 0x43, 0x77, 0x42, 0x2b, 0x6c, 0x55, 0x35, 0x78, 0x5a, 0x31, 0x55, 0x54,
		0x51, 0x6d, 0x36, 0x74, 0x55, 0x6e, 0x45, 0x43, 0x53, 0x44, 0x34, 0x59, 0x4b, 0x35, 0x34, 0x6a, 0x4e,
		0x32, 0x46, 0x49, 0x31, 0x52, 0x78, 0x4f, 0x6a, 0x58, 0x44, 0x79, 0x50, 0x63, 0x36, 0x4d, 0x47, 0x6e,
		0x67, 0x6e, 0x4c, 0x68, 0x2f, 0x4c, 0x31, 0x31, 0x46, 0x4e, 0x69, 0x6e, 0x49, 0x42, 0x30, 0x61, 0x55,
		0x53, 0x75, 0x63, 0x2f, 0x63, 0x6e, 0x76, 0x41, 0x52, 0x45, 0x41, 0x4a, 0x52, 0x50, 0x65, 0x39, 0x2b,
		0x42, 0x69, 0x50, 0x30, 0x69, 0x66, 0x6c, 0x53, 0x51, 0x45, 0x48, 0x6e, 0x63, 0x4d, 0x57, 0x30, 0x43,
		0x6d, 0x47, 0x6a, 0x42, 0x30, 0x6d, 0x30, 0x75, 0x43, 0x65, 0x77, 0x70, 0x63, 0x4d, 0x50, 0x73, 0x43,
		0x44, 0x4f, 0x52, 0x78, 0x4b, 0x4b, 0x2b, 0x4d, 0x4c, 0x35, 0x54, 0x38, 0x75, 0x4c, 0x4e, 0x65, 0x6d,
		0x4b, 0x58, 0x45, 0x50, 0x4f, 0x69, 0x36, 0x4c, 0x77, 0x49, 0x6b, 0x39, 0x38, 0x63, 0x6b, 0x64, 0x61,
		0x4f, 0x65, 0x76, 0x58, 0x39, 0x42, 0x62, 0x4c, 0x5a, 0x4e, 0x77, 0x7a, 0x51, 0x35, 0x4d, 0x42, 0x73,
		0x33, 0x6e, 0x50, 0x50, 0x48, 0x6c, 0x47, 0x39, 0x44, 0x70, 0x72, 0x68, 0x63, 0x6b, 0x67, 0x73, 0x44,
		0x48, 0x43, 0x75, 0x73, 0x72, 0x43, 0x34, 0x4b, 0x71, 0x5a, 0x48, 0x2f, 0x32, 0x39, 0x52, 0x54, 0x78,
		0x70, 0x58, 0x6d, 0x65, 0x39, 0x43, 0x4e, 0x50, 0x43, 0x6f, 0x6b, 0x61, 0x52, 0x6f, 0x70, 0x31, 0x77,
		0x77, 0x33, 0x54, 0x4e, 0x39, 0x79, 0x72, 0x5a, 0x68, 0x6d, 0x38, 0x55, 0x47, 0x47, 0x4b, 0x48, 0x66,
		0x55, 0x33, 0x59, 0x42, 0x63, 0x66, 0x77, 0x32, 0x57, 0x6f, 0x78, 0x36, 0x50, 0x58, 0x72, 0x61, 0x7a,
		0x48, 0x37, 0x52, 0x6a, 0x72, 0x66, 0x4b, 0x57, 0x62, 0x59, 0x69, 0x4b, 0x56, 0x79, 0x48, 0x67, 0x36,
		0x56, 0x4e, 0x45, 0x32, 0x4e, 0x4f, 0x75, 0x6d, 0x41, 0x76, 0x36, 0x54, 0x30, 0x58, 0x48, 0x78, 0x2b,
		0x39, 0x39, 0x53, 0x71, 0x6f, 0x58, 0x30, 0x6c, 0x6d, 0x39, 0x4a, 0x7a, 0x30, 0x39, 0x77, 0x53, 0x74,
		0x54, 0x59, 0x35, 0x33, 0x71, 0x66, 0x6d, 0x4e, 0x32, 0x31, 0x36, 0x41, 0x69, 0x32, 0x73, 0x57, 0x39,
		0x72, 0x66, 0x2b, 0x74, 0x70, 0x7a, 0x7a, 0x6a, 0x6a, 0x36, 0x67, 0x3d, 0x3d, 0x22, 0x7d, 0x2c, 0x22,
		0x45, 0x43, 0x43, 0x22, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x7d}
	testpcr = []byte{
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x30, 0x30, 0x0a, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x30, 0x31, 0x0a, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x30, 0x32, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x30, 0x33, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73,
		0x68, 0x61, 0x31, 0x20, 0x30, 0x34, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61,
		0x31, 0x20, 0x30, 0x35, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20,
		0x30, 0x36, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x30, 0x37,
		0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x30, 0x38, 0x0a, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x30, 0x39, 0x0a, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x31, 0x30, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x31, 0x31, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20,
		0x73, 0x68, 0x61, 0x31, 0x20, 0x31, 0x32, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68,
		0x61, 0x31, 0x20, 0x31, 0x33, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31,
		0x20, 0x31, 0x34, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x31,
		0x35, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x31, 0x36, 0x0a,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x31, 0x37, 0x0a, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x31, 0x38, 0x0a, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x31, 0x39, 0x0a, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x20, 0x73, 0x68, 0x61, 0x31, 0x20, 0x32, 0x30, 0x0a, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x20, 0x73,
		0x68, 0x61, 0x31, 0x20, 0x32, 0x31, 0x0a, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
		0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x20, 0x73, 0x68, 0x61,
		0x31, 0x20, 0x32, 0x32, 0x0a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
		0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x73, 0x68, 0x61, 0x31, 0x20,
		0x32, 0x33, 0x0a}
	testtareport = []byte(
		`
{
        "report_sign":  {
                "sce_no_as":    "RIipRRfPKYILcAVDNr5F0Y13Y4tV2XH9MJD54VkAweVLeVLfUmkhAzVCN65yAts6pk51_nQiSZWcwMFePEMC5e93Mgkvls1f1pqnkDa6UcXUO-7Mm3gm1sDXr1lp5pClUQ_xGleOlHxRl7KiPwVCNm5dShgF2zrXk_F4dhrf06o4GU12HwTMhvs7m2CCp2VF76CBoJaveiZDUpZA6tHebtvqIWEUtqEyIuAVtOGee7bSoGJC54CtZmy_YzkB3W3RaWtPMus2vVdV1JZgEcdni_VVw1mBkicON9O2g1Vk2S8y75wql3q7-MgHyR13Pc9hgvXZYg8Lts3yo0CdvD9NPsKgA2LoB_rRHjd3PLe87mXYNhOErHnZotTTmD3GKOiU0fPnfyXCqGXOCS6by3hpiY9QclSP8inYUjGtxElTyzDJaXM-y1iExxvMdj1zQPkcSpk32ZAakDEH2fOEiCmU0cYTcdJTzEoBTw8hGoNb0FOFUMc-YVQCx9VzMjYF_-wD0xmyLzmVrWuwytQ6Dg8tIacILlt27bV8PZnLoyS0vOMIGjJ7A-NpmJSJRL5WGs7Hx-5WTVOR9Xg3p6z7jJypB61FMdkvpgltw89eYt7TVjyyrCovpJUg-zKg2YbET2_-GyjHoCLNutuVvGqPNEH9I4Kh9MZEKzZiiKKutJUhF_E"
        },
        "akcert":       {
                "sce_no_as":    {
                        "signature":    {
                                "drk_cert":     "TUlJRWtqQ0NBM3FnQXdJQkFnSVJFVk9HdExqeldMKzk2WEpGeWlYSVEwOHdEUVlKS29aSWh2Y05BUUVMQlFBd1BURUxNQWtHQTFVRUJoTUNRMDR4RHpBTkJnTlZCQW9UQmtoMVlYZGxhVEVkTUJzR0ExVUVBeE1VU0hWaGQyVnBJRWxVSUZCeWIyUjFZM1FnUTBFd0hoY05Nakl3TkRFeE1EWXpOVEF5V2hjTk16Y3dOREEzTURZek5UQXlXakE2TVFzd0NRWURWUVFHRXdKRFRqRVBNQTBHQTFVRUNoTUdTSFZoZDJWcE1Sb3dHQVlEVlFRREV4RXdNalpRVUZZeE1FdERNREEwTVRjNVZEQ0NBaUl3RFFZSktvWklodmNOQVFFQkJRQURnZ0lQQURDQ0Fnb0NnZ0lCQU5uOGJ6SXJneGFBNFh6RkZYSzhZYUhOVU5IZ2hoRzJZeEg4Znc4a0lTL1BaY3NkZXo2WTVLZ3BNVDJ0ZTRkVkpYa2FDeFVld1IxZm1Vb1AwZStsaWtYeVlaZm1xeDF6SVZoazRtM2tuK0lYN3g5c3RMeitvR0NaYXg2MXMrdURhNnBITGN4VDVKWUZZaFVHZ2FlbE1wS2lxamEvSFo2aHRCUW1oZ1YvNFFxTHl0ellKSlc2ZVFoRnMrQW9URUx5RmFBa0JXUlkzaVFRbE55NmhsV2xGa0xUQkdYSWYvZ0E2MmgyeE5wd3BPVkdjRi9mL2ZrdTBlR3JVZHVZUG04YVRlNnNITzZIOVdhY0xwU28wd1Nqc2hoME8xUzdrcWVJUTFLdWhDY0lkQnJKRWNyalA5RFUzQnJweGxzck5JKytHeTV0ays5Q3RZTzVsTktVbTJHUVpDUlZKaDFxUWNXb3hQWTZUYkNJZTZiMi9oaFJGdHVJM2VYcGczLzlmWW1NYllKb3ZTb1dxekErUzZCL092dmdCVjFhNzNod2kvQldiWjg5bWM3WG52S3I1MVBFeUIrTnMrRUpxczVXWTNnVy93VWlmajh3VWVSS2VqV3hnQzVwSkJVRzlPWWNyc2JZaExzdFAycHdvSHFaK2RFa1kxbytPY2hvWm5XYVl5ZHdYZDgwQWNiNWNkOU1RMUgyc1ZkMUxUb3BXMEt2SGhHUVE1OE1rTVFVSWdPRjVXam1pWExVc0NhcER3bHZrREdwc282UGFpN3VRTmZFOS95TjZRWlg4VXFscE5oNTAvVzcrK0ZrNUtKWWE3b1lDU2Q4Zk9tVElHTFpuUWRxNUFTWlZWM0d4Y2RxUDVGcmdwVVIzUUIvT3dUNzdWZjhMNlJBbjg0aU9Ec2ZQREJ6QWdNQkFBR2pnWTh3Z1l3d0h3WURWUjBqQkJnd0ZvQVVFb28zN1BselY5ZmtnN3ExYndQczNhNFJUczh3Q3dZRFZSMFBCQVFEQWdQNE1Gd0dDQ3NHQVFVRkJ3RUJCRkF3VGpBb0JnZ3JCZ0VGQlFjd0FvWWNhSFIwY0Rvdkx6RXlOeTR3TGpBdU1TOWpZV2x6YzNWbExtaDBiVEFpQmdnckJnRUZCUWN3QVlZV2FIUjBjRG92THpFeU55NHdMakF1TVRveU1EUTBNekFOQmdrcWhraUc5dzBCQVFzRkFBT0NBUUVBSFc1OWZtTGNVMmQraWNuY2FHWGVoU3JlSEVjUThVbWRYWDE1a3E3eStnWTNJZklpTUgxSUNNVFZLL1hEbFZZR3ltMXFvUXdiV3hPSi9GOEFnOEFZVk1YcVpHZWtRRThCZGZNTk1tQmdnOWh6R3VoWEl2K2xzN3g5dVJBbEpEVlYyNWtOOWFNWC82RVBZNmk5cUgxTzlKdzdRRWd3T2JlTE5FM1VaY245bE90Q1BXZFhnWENROTlnNm1iSTA3Sng3Zlk0UStzVUpOQkxqNDVicy9JSUNjUGpBUS9HYjd6NEhScEtDREIzU3R6NmZaM0hjUlZiVy9BMmN3MUh3UDI3bXBuWXE4b290d216S1lydFpzbCs4YjhYQnFvME1zbWlYNmpHcTFJSi9hdjNDcUMxN0VGK2NwU3RrbXZacWFlZGdaVndPc1M2ZG83MXh4K0JnUFZlMnpnPT0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                                "drk_sign":     "j6YnW9t0RbxYkGt_KQoHdvHoeTHm40V6UWkaazcOY1igfi9XjBB_OGDHMx0uWJijhHGbpOx93sNgVc3yQJBLiQwxkLMeYIc6qaTZBaiiq9kxj-FGI952bbv65WF_JfPeCXvrgl0Hlhen1fhVV22PMmoK_MJ6vB9Pw5bsbTvCFpwlFA963X0_XWNLAzETp5rbjdkZd7dOmBmYFjm6DfrfO86xNeVrWYEomhpVYChEYkXSWkAeS7OCBSQHFJaw5HnKRtPGQDIe8C8cnPX8cI2RF-KVmBODxRz8mRQYosrrHMj8RqO0KG2JgPwmXZvLNahWDh_GyLBStHHNh7oDYmfX_DFEfqZlSrSUJCkmtQnO6-COW8KM85l1EYz9SFzwcdjh-qgG6p80NyfULDBTIUTNY6rFKTCGqD19BSd8HlOaaoSdw3nXlR4xSpMO3TxojLCkSOup8QtLO6bgUN5vJBEXuo6U33FcQXn-4-wL9SPuAOsa1PV7sSGk17nT31bT7LfqNzM4OO8eYnrPG98xM_Te6nkVJSfUc1e7mRelNUtZpwIxRRIhnDn37pAcqpCESiANxSko8-353ty8cm4VChUsRomR7AtFgRBuPqRrHx2J3eiRE5FsIiXBaMdEXbXHE70wexgEtw0RwhtgHv87iMgLo5H_D9KGWTByzNbjtC04W9g"
                        },
                        "payload":      {
                                "version":      "TEE.RA.1.0",
                                "timestamp":    "9223372036854770000",
                                "scenario":     "sce_no_as",
                                "sign_alg":     "PS256",
                                "hash_alg":     "HS256",
                                "qta_img":      "FaOPRQvji8yNYvo1K8XDMDXXK2lkwiegprur8djeKgc",
                                "qta_mem":      "KlYpkZzjREFXd0GwwgLas3gJ60HB0DQfsn8sHlZ7SjE",
                                "tcb":  "",
                                "ak_pub":       {
                                        "kty":  "RSA",
                                        "n":    "yf1gDkBMbaI7Z9t6A2WPBjRB3PfYaSPV0_hxu44bx53_Qt1pyvH4Y-S_34HJN5lIcdAxk-iuaTclK6VqZ919chgmlwf46peN0TCI0l4ijtgfpHn-naeeeVztyXBIc_xRJKLG24XPaszZoG9StlfpJOB8-WvAqw-c6wtc1I9BLkooGUYfJ-eddpD1-22DtfcgIKxOwp3eM0N5FQoN5bYAHIT68ZLE2ZsfhTuEfnm6uZDoETk-H21BiSICwReqmXyGrWC6-ISE4W5hz1vEZnz7u66a5CXt0Xaz6WiJ3dOYAa-a4rXDO4lGTttZ6wWu6QHANQC5HxrO0ySr8p5G2RK5tsrEG8yZMExo66bfJ9y2JhT4QQ8Xsh1CVGA6mZzxK4Ir56cjv8_ZHhYQNzOi4Y6KSm_4unR1p5USD_KFKQpXTrb_4fo3oJ8h_hWnGunc7FVUNuQGNbCqeuwsWfptyqQDH6CjqW1Z6mMR64rYaoOOxZohSdmmZH5xbW2h_5wkhkQK3Rv15oHuJX8j5Yz8NED6bXTOU1t28E4c1HAPRAEGNF3PxCWWiBiwWAfGHhbRvZIZ3pFVNHciag_E8e90tXQIP0aiYEn22esDTY4CpaMDEzsrkLd351QSEbW7uJACQBBH8PZvhNCLMIkGayh82NOu4cNjErG95BcElYHX0H40MoE",
                                        "e":    "AQAB"
                                }
                        },
                        "handler":      "provisioning-output"
                }
        },
        "payload":      {
                "version":      "TEE.RA.1.0",
                "timestamp":    "9223372036854775800",
                "nonce":        "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5_gA",
                "scenario":     "sce_no_as",
                "uuid": "e08f7eca-e875-440e-9ab0-5f381136c600",
                "hash_alg":     "HS256",
                "sign_alg":     "PS256",
                "ta_mem":       "KlYpkZzjREFXd0GwwgLas3gJ60HB0DQfsn8sHlZ7SjE",
                "ta_img":       "FaOPRQvji8yNYvo1K8XDMDXXK2lkwiegprur8djeKgc",
                "ta_attr":      "",
                "tcb":  ""
        },
        "handler":      "report-output"
}
`)
	testClientInfo = map[string]string{"test name": "test value"}
	imaLog         = `10 e1bfae9f832b73b57bacb2bdf7f93bc1604ea344 ima 00216393538702616d9ba663141ca8063b901f58 /usr/bin/cat
10 bb52e22661080b7c53e0cab9f85654f0ccb89393 ima ad0c3fcd470080ec3abed12de33106b206e3eef3 /etc/issue`
	rootCert = `-----BEGIN CERTIFICATE-----
MIIEsTCCApmgAwIBAgIRdjl5z9FobnagzdStBIQZVIcwDQYJKoZIhvcNAQELBQAw
PDELMAkGA1UEBhMCQ04xDzANBgNVBAoTBkh1YXdlaTEcMBoGA1UEAxMTSHVhd2Vp
IEVxdWlwbWVudCBDQTAeFw0xNjEwMTgwNjUwNTNaFw00MTEwMTIwNjUwNTNaMD0x
CzAJBgNVBAYTAkNOMQ8wDQYDVQQKEwZIdWF3ZWkxHTAbBgNVBAMTFEh1YXdlaSBJ
VCBQcm9kdWN0IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtKE3
0649koONgSJqzwKXpSxTwiGTGorzcd3paBGH75Zgm5GFv2K2TG3cU6seS6dt7Ig+
/8ntrcieQUttcWxpm2a1IBeohU1OTGFpomQCRqesDnlXXUS4JgZiDvPBzoqGCZkX
YRw37J5KM5TSZzdLcWgxAPjXvKPdLXfxGzhqg8GV1tTboqXoNEqVqOeViBjsjN7i
xIuu1Stauy9E0E5ZnSrwUjHc5QrR9CmWIu9D0ZJJp1M9VgcXy9evPhiHoz9o+KBd
fNwt4e/NymTqaPa+ngS/qZwI7A4tR4RKCMKFHJcsjaXwUb0RuIeCiPO3wPHgXmGL
uiKfyPV8SMLpE/wYaQIDAQABo4GsMIGpMB8GA1UdIwQYMBaAFCr4EFkngDUfp3y6
O58q5Eqqm5LqMEYGA1UdIAQ/MD0wOwYEVR0gADAzMDEGCCsGAQUFBwIBFiVodHRw
Oi8vc3VwcG9ydC5odWF3ZWkuY29tL3N1cHBvcnQvcGtpMA8GA1UdEwQIMAYBAf8C
AQAwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQSijfs+XNX1+SDurVvA+zdrhFO
zzANBgkqhkiG9w0BAQsFAAOCAgEAAg1oBG8YFvDEecVbhkxU95svvlTKlrb4l77u
cnCNhbnSlk8FVc5CpV0Q7SMeBNJhmUOA2xdFsfe0eHx9P3Bjy+difkpID/ow7oBH
q2TXePxydo+AxA0OgAvdgF1RBPTpqDOF1M87eUpJ/DyhiBEE5m+QZ6VqOi2WCEL7
qPGRbwjAFF1SFHTJMcxldwF6Q/QWUPMm8LUzod7gZrgP8FhwhDOtGHY5nEhWdADa
F9xKejqyDCLEyfzsBKT8V4MsdAo6cxyCEmwiQH8sMTLerwyXo2o9w9J7+vRAFr2i
tA7TwGF77Y1uV3aMj7n81UrXxqx0P8qwb467u+3Rj2Cs29PzhxYZxYsuov9YeTrv
GfG9voXz48q8ELf7UOGrhG9e0yfph5UjS0P6ksbYInPXuuvrbrDkQvLBYb9hY78a
pwHn89PhRWE9HQwNnflTZS1gWtn5dQ4uvWAfX19e87AcHzp3vL4J2bCxxPXEE081
3vhqtnU9Rlv/EJAMauZ3DKsMMsYX8i35ENhfto0ZLz1Aln0qtUOZ63h/VxQwGVC0
OCE1U776UUKZosfTmNLld4miJnwsk8AmLaMxWOyRsqzESHa2x1t2sXF8s0/LW5T7
d+j7JrLzey3bncx7wceASUUL3iAzICHYr728fNzXKV6OcZpjGdYdVREpM26sbxLo
77rH32o=
-----END CERTIFICATE-----`
)

var (
	deviceId int64 = 17
	basetype       = []string{"host", "container", "device"}
)

func RemoveFiles() {
	os.Remove("./pca-root.crt")
	os.Remove("./pca-root.key")
	os.Remove("./pca-ek.crt")
	os.Remove("./pca-ek.key")
	os.Remove("./https.crt")
	os.Remove("./https.key")
	os.Remove(rootCertFilePath)
}

func TestRegisterClient(t *testing.T) {
	clients := []struct {
		IK   string
		Info string
	}{
		{"1", `{"ip": "10.0.0.1", "name": "wucaijun1", "num": 123}`},
		{"2", `{"ip": "10.0.0.2", "name": "wucaijun2", "num": 123}`},
		{"3", `{"ip": "10.0.0.3", "name": "wucaijun3", "num": 123}`},
		{"4", `{"ip": "10.0.0.4", "name": "wucaijun4", "num": 123}`},
		{"5", `{"ip": "10.0.0.5", "name": "wucaijun5", "num": 123}`},
		{"6", `{"ip": "10.0.0.6", "name": "wucaijun6", "num": 123}`},
		{"7", `{"ip": "10.0.0.7", "name": "wucaijun7", "num": 123}`},
	}
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	tt := time.Now().Format("06-01-02-15-04-05.999")
	for _, c := range clients {
		RegisterClientByIK(c.IK+tt, c.Info, true)
		c1, err := FindClientByIK(c.IK + tt)
		if err != nil {
			t.Errorf("test FindClientByIK failed, err: %s", err)
		}
		defer DeleteClientByID(c1.ID)
	}
	GetAllNodes(1, 7)
	UpdateAllNodes()
}

func TestFindClient(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	c, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(c.ID)
	c1, err := FindClientByIK(c.IKCert)
	if err == nil {
		t.Logf("find client by ik=%s, c=%v\n", c1.IKCert, c1)
	} else {
		t.Errorf("find by ik error: %v", err)
	}
	c2, err := FindClientByID(c.ID)
	if err == nil {
		t.Logf("find client by id=%d, c=%v\n", c2.ID, c2)
	} else {
		t.Errorf("find by id error: %v", err)
	}
	info2 := `{"name": "google DNS"}`
	c3, err := FindClientsByInfo(info2)
	if err == nil {
		t.Logf("find client by info=%s\n", info2)
		for i, v := range c3 {
			t.Logf("  %d, %v\n", i, v)
		}
	} else {
		t.Errorf("find by info error: %v", err)
	}
	if !assert.Equal(t, c1, c2, c3) {
		t.Errorf("test Client failed")
	}
	UnRegisterClientByID(c.ID)
}

func CreateBiosAndImaFile() {
	err := ioutil.WriteFile(testImaLogPath, []byte("test ima"), 0644)
	if err != nil {
		return
	}
	err1 := ioutil.WriteFile(testBiosLogPath, []byte("test bios"), 0644)
	if err1 != nil {
		return
	}
}

func RemoveBiosAndImaFile() {
	err := os.Remove(testImaLogPath)
	if err != nil {
		return
	}
	err1 := os.Remove(testBiosLogPath)
	if err1 != nil {
		return
	}
}

func CreateRasConfigFile() {
	err := ioutil.WriteFile(configFilePath, []byte(rasConfig), 0644)
	if err != nil {
		return
	}
}

func RemoveConfigFile() {
	err := os.Remove(configFilePath)
	if err != nil {
		return
	}
}

func CreateRootCert() {
	err := ioutil.WriteFile(rootCertFilePath, []byte(rootCert), 0644)
	if err != nil {
		return
	}
}

func TestReport(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)

	row := &typdefs.ReportRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
	}
	_, err = storeDb.Exec(sqlInsertTrustReport,
		row.ClientID, row.CreateTime, row.Validated, row.Trusted,
		row.Quoted, row.Signature, row.PcrLog, row.BiosLog, row.ImaLog)
	if err != nil {
		t.Errorf("insert trust report error,  %v", err)
	}
	defer DeleteClientByID(cRow.ID)
	c1, err := FindReportsByClientID(row.ClientID)
	if err != nil {
		t.Errorf("FindReportByID failed, err: %s", err)
	}
	if len(c1) != 0 {
		_, err := FindReportByID(c1[0].ID)
		if err != nil {
			t.Errorf("FindReportByID failed, err: %s", err)
		}
		DeleteReportByID(c1[0].ID)
	}
	//mgr.SaveReport(c.ID, []byte("haha"))
}

func TestBaseValue(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)

	baseRow := &typdefs.BaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Uuid:       "abc",
	}
	_, err = storeDb.Exec(sqlInsertBase, baseRow.ClientID, baseRow.BaseType, baseRow.Uuid, baseRow.CreateTime,
		baseRow.Enabled, baseRow.Name, baseRow.Pcr, baseRow.Bios, baseRow.Ima)
	if err != nil {
		t.Errorf("insert base error, %v", err)
	}

	c1, err := FindBaseValueByUuid(baseRow.Uuid)
	if err != nil {
		t.Errorf("FindBaseValueByUuid failed, err: %s", err)
	}
	if c1.Enabled {
		t.Log("ModifyEnabledByID success")
	}
	defer DeleteBaseValueByID(c1.ID)
	c2, err := FindBaseValueByID(c1.ID)
	if err != nil {
		t.Errorf("FindBaseValueByID failed, err: %s", err)
	}
	if !assert.Equal(t, c1, c2) {
		t.Errorf("test Base failed")
	}
	//mgr.SaveReport(c.ID, []byte("haha"))
}

func TestTaBaseValue(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)

	tabaseRow := &typdefs.TaBaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Uuid:       "ta1",
	}
	_, err = storeDb.Exec(sqlInsertTaBase, tabaseRow.ClientID, tabaseRow.Uuid, tabaseRow.CreateTime, true,
		tabaseRow.Name, tabaseRow.Valueinfo)
	if err != nil {
		t.Errorf("insert ta base error, %v", err)
	}

	c1row, err := FindTaBaseValuesByUuid(tabaseRow.ClientID, tabaseRow.Uuid)
	if err != nil {
		t.Errorf("FindTaBaseValueByUuid failed, err: %s", err)
	}
	for _, c1 := range c1row {
		defer DeleteTaBaseValueByID(c1.ID)
	}

	c2, err := FindTaBaseValueByID(c1row[0].ID)
	if err != nil {
		t.Errorf("FindBaseValueByID failed, err: %s", err)
	}

	c3, err := FindTaBaseValuesByCid(c2.ClientID)
	if err != nil {
		t.Errorf("FindTaBaseValuesByCid failed, err: %s", err)
	}
	if !assert.Equal(t, c1row[0], c2, c3) {
		t.Errorf("test TaBase failed")
	}
}

func TestTaReport(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)

	row := &typdefs.TaReportRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
	}
	_, err = storeDb.Exec(sqlInsertTaReport,
		row.ClientID, row.CreateTime, row.Validated, row.Trusted,
		row.Uuid, row.Value)
	if err != nil {
		t.Errorf("insert ta report error,  %v", err)
	}
	defer DeleteClientByID(cRow.ID)
	c1, err := FindTaReportsByUuid(row.ClientID, row.Uuid)
	if err != nil {
		t.Errorf("FindTaReportsByUuid failed, err: %s", err)
	}
	if len(c1) != 0 {
		_, err := FindTaReportByID(c1[0].ID)
		if err != nil {
			t.Errorf("FindTaReportByID failed, err: %s", err)
		}
		DeleteTaReportByID(c1[0].ID)
	}
}

func TestEnableValue(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)

	baseRow := &typdefs.BaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Uuid:       "abc",
	}
	_, err = storeDb.Exec(sqlInsertBase, baseRow.ClientID, baseRow.BaseType, baseRow.Uuid, baseRow.CreateTime,
		baseRow.Enabled, baseRow.Name, baseRow.Pcr, baseRow.Bios, baseRow.Ima)
	if err != nil {
		t.Errorf("insert base error, %v", err)
	}

	err = ModifyEnabledByID(baseRow.ID, true)
	if err != nil {
		t.Errorf("ModifyEnabledByID failed, err: %s", err)
	}
	c1, err := FindBaseValueByUuid(baseRow.Uuid)
	if err != nil {
		t.Errorf("FindBaseValueByUuid failed, err: %s", err)
	}
	if c1.Enabled {
		t.Log("ModifyEnabledByID success")
	}
	defer DeleteBaseValueByID(c1.ID)
	err = DisableBaseByClientID(baseRow.ID)
	if err != nil {
		t.Errorf("DisableBaseByClientID failed, err: %s", err)
	}
	c2, err := FindBaseValueByUuid(baseRow.Uuid)
	if err != nil {
		t.Errorf("FindBaseValueByUuid failed, err: %s", err)
	}
	if !c2.Enabled {
		t.Log("DisableBaseByClientID success")
	}
}

func TestTaEnableValue(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)

	tabaseRow := &typdefs.TaBaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Uuid:       "ta1",
	}
	_, err = storeDb.Exec(sqlInsertTaBase, tabaseRow.ClientID, tabaseRow.Uuid, tabaseRow.CreateTime, true,
		tabaseRow.Name, tabaseRow.Valueinfo)
	if err != nil {
		t.Errorf("insert ta base error, %v", err)
	}

	err = DisableTaBaseByUuid(tabaseRow.ClientID, tabaseRow.Uuid)
	if err != nil {
		t.Errorf("DisableTaBaseByUuid failed, err: %s", err)
	}
	c1row, err := FindTaBaseValuesByUuid(tabaseRow.ClientID, tabaseRow.Uuid)
	if err != nil {
		t.Errorf("FindTaBaseValueByUuid failed, err: %s", err)
	}
	for _, c1 := range c1row {
		defer DeleteTaBaseValueByID(c1.ID)
	}

	err = ModifyTaEnabledByID(c1row[0].ID, true)
	if err != nil {
		t.Errorf("ModifyTaEnabledByID failed, err: %s", err)
	}
	c2, err := FindTaBaseValueByID(c1row[0].ID)
	if err != nil {
		t.Errorf("FindBaseValueByID failed, err: %s", err)
	}
	if !assert.Equal(t, c1row[0], c2) {
		t.Errorf("test TaBase failed")
	}
}

func TestCache(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	regtime := time.Time{}
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	RegisterClientByID(deviceId, regtime, ik)
	defer DeleteClientByID(deviceId)
	_, err := GetCache(deviceId)
	if err != nil {
		t.Errorf("GetCache failed, err: %s", err)
	}
	UpdateCaches()
}

func TestValueByClientID(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)
	baseRow := &typdefs.BaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Uuid:       "abc",
	}
	for i := 0; i < Three; i++ {
		for j := 0; j < Three; j++ {
			_, err = storeDb.Exec(sqlInsertBase, baseRow.ClientID, basetype[i], baseRow.Uuid, time.Now(),
				baseRow.Enabled, baseRow.Name, baseRow.Pcr, baseRow.Bios, baseRow.Ima)
			if err != nil {
				t.Errorf("insert base %d error, %v", i, err)
			}
		}

	}

	c1row, err := FindBaseValuesByClientID(baseRow.ClientID)
	if err != nil {
		t.Errorf("FindBaseValuesByClientID failed, err: %s", err)
	}
	for _, c1 := range c1row {
		t.Logf(c1.BaseType)
		t.Log(c1.Uuid)
		t.Log(c1.CreateTime)
		t.Log(c1.Pcr)
		defer DeleteBaseValueByID(c1.ID)
	}

	_, err = FindHostBaseValuesByClientID(baseRow.ClientID)
	if err != nil {
		t.Errorf("FindHostBaseValuesByClientID failed, err: %s", err)
	}

	_, err = FindContainerBaseValuesByClientID(baseRow.ClientID)
	if err != nil {
		t.Errorf("FindContainerBaseValuesByClientID failed, err: %s", err)
	}

	_, err = FindDeviceBaseValuesByClientID(baseRow.ClientID)
	if err != nil {
		t.Errorf("FindDeviceBaseValuesByClientID failed, err: %s", err)
	}
}

func TestHandleHeartbeat(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	regtime := time.Time{}
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	RegisterClientByID(deviceId, regtime, ik)
	defer DeleteClientByID(deviceId)
	c, err := GetCache(deviceId)
	if err != nil {
		t.Errorf("GetCache failed, err: %s", err)
	}
	c.SetCommands(1)
	c.GetNonce()
	cmds, nonce := HandleHeartbeat(deviceId)
	if cmds == typdefs.CmdNone || nonce == 0 {
		t.Errorf("HandleHeartbeat failed, err: %s", err)
	}
}

func ReadCert(pathname string) ([]byte, error) {
	file, err := os.Open(pathname)
	if err != nil {
		return nil, err
	}
	defer file.Close()

	fileInfo, err := file.Stat() // get file propertity
	if err != nil {
		return nil, err
	}

	fileSize := fileInfo.Size()
	buffer := make([]byte, fileSize)

	_, err = file.Read(buffer) // read file
	if err != nil {
		return nil, err
	}
	return buffer, nil
}

func TestValidateReport(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	CreateRasConfigFile()
	defer RemoveConfigFile()
	CreateRootCert()
	config.InitFlags()
	config.LoadConfigs()
	config.HandleFlags()
	defer RemoveFiles()
	// ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	IKpubBlock, _ := pem.Decode([]byte(IKpubPEM))
	template := x509.Certificate{
		SerialNumber: big.NewInt(cryptotools.GetSerialNumber()),
		NotBefore:    time.Now(),
		NotAfter:     time.Now().AddDate(1, 0, 0),
		KeyUsage: x509.KeyUsageDigitalSignature |
			x509.KeyUsageKeyEncipherment | x509.KeyUsageCertSign,
		IsCA:           false,
		MaxPathLenZero: true,
		IPAddresses:    []net.IP{net.ParseIP(config.GetIP())},
	}
	ikCertDer, err := cryptotools.GenerateCertificate(&template,
		config.GetPcaKeyCert(), IKpubBlock.Bytes, config.GetPcaPrivateKey())
	if err != nil {
		t.Errorf("GenerateCertificate failed error, %v", err)
	}
	ikPem, err := cryptotools.EncodeKeyCertToPEM(ikCertDer)
	if err != nil {
		t.Errorf("EncodeKeyCertToPEM failed error, %v", err)
	}
	ci, err := json.Marshal(testClientInfo)
	if err != nil {
		t.Errorf("json Marshal testClientInfo failed error, %v", err)
	}
	cRow, err := RegisterClientByIK(string(ikPem), string(ci), true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)
	c, err := GetCache(cRow.ID)
	if err != nil {
		t.Errorf("GetCache failed, err: %s", err)
	}
	c.SetCommands(1)
	c.SetIKeyCert(string(ikPem))
	if c == nil {
		t.Errorf("Cache empty failed, err: %s", err)
	}
	nonce := c.GetNonce()
	testbios, _ := ioutil.ReadFile(BIOSLogPath)
	testima, _ := ioutil.ReadFile(IMALogPath)
	var ms []typdefs.Manifest
	ms = make([]typdefs.Manifest, 0, 3)
	inms := []typdefs.Manifest{
		{Key: "pcr", Value: testpcr},
		{Key: "bios", Value: testbios},
		{Key: "ima", Value: testima},
	}
	for _, im := range inms {
		m := typdefs.Manifest{
			Key:   im.Key,
			Value: im.Value,
		}
		ms = append(ms, m)
	}
	tareport := make(map[string][]byte)
	tareport["ta1"] = testtareport
	trustreport := &typdefs.TrustReport{
		ClientID:   cRow.ID,
		Nonce:      nonce,
		ClientInfo: string(ci),
		Quoted:     testquote,
		Signature:  testsignature,
		Manifests:  ms,
		TaReports:  tareport,
	}
	_, err = ValidateReport(trustreport, true)
	if err != nil {
		t.Errorf("ValidateReport failed error, %v", err)
	}
}

func TestHandleBaseValue(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	CreateRasConfigFile()
	defer RemoveConfigFile()
	config.LoadConfigs()
	config.HandleFlags()
	defer RemoveFiles()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	ci, err := json.Marshal(testClientInfo)
	if err != nil {
		t.Errorf("json Marshal testClientInfo failed error, %v", err)
	}
	cRow, err := RegisterClientByIK(ik, string(ci), true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow.ID)
	c, err := GetCache(cRow.ID)
	if err != nil {
		t.Errorf("GetCache failed, err: %s", err)
	}
	c.SetIsAutoUpdate(true)
	base1 := &typdefs.BaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Enabled:    true,
		Verified:   true,
		Trusted:    true,
		BaseType:   typdefs.StrHost,
	}
	c.SetBases(base1)
	base2 := &typdefs.BaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Enabled:    true,
		Verified:   true,
		Trusted:    true,
		BaseType:   typdefs.StrContainer,
	}
	c.SetBases(base2)
	nonce := c.GetNonce()
	testbios, _ := ioutil.ReadFile(BIOSLogPath)
	testima, _ := ioutil.ReadFile(IMALogPath)
	var ms []typdefs.Manifest
	ms = make([]typdefs.Manifest, 0, 3)
	inms := []typdefs.Manifest{
		{Key: "pcr", Value: testpcr},
		{Key: "bios", Value: testbios},
		{Key: "ima", Value: testima},
	}
	for _, im := range inms {
		m := typdefs.Manifest{
			Key:   im.Key,
			Value: im.Value,
		}
		ms = append(ms, m)
	}
	tareport := make(map[string][]byte)
	tareport["ta1"] = testtareport
	trustreport1 := &typdefs.TrustReport{
		ClientID:   cRow.ID,
		Nonce:      nonce,
		ClientInfo: string(ci),
		Quoted:     testquote,
		Signature:  testsignature,
		Manifests:  ms,
		TaReports:  tareport,
	}
	err = HandleBaseValue(trustreport1)
	if err != nil {
		t.Errorf("HandleBaseValue failed with isautoupdate=true error, %v", err)
	}

	c.SetIsAutoUpdate(true)
	c.ClearBases()
	c.SetBases(base2)
	base3 := &typdefs.BaseRow{
		ClientID:   cRow.ID,
		CreateTime: time.Now(),
		Enabled:    true,
		Verified:   true,
		Trusted:    true,
		BaseType:   typdefs.StrDevice,
	}
	c.SetBases(base3)
	err = HandleBaseValue(trustreport1)
	if err != nil {
		t.Errorf("HandleBaseValue failed with isautoupdate=true and base.BaseType != \"host\" error, %v", err)
	}

	err = HandleBaseValue(trustreport1)
	if err != nil {
		t.Errorf("HandleBaseValue failed with isautoupdate=false and MgrStrategy=auto error, %v", err)
	}

	config.SetMgrStrategy("manual")
	err = HandleBaseValue(trustreport1)
	if err != nil {
		t.Errorf("HandleBaseValue failed with autoupdate=true and MgrStrategy=manual error, %v", err)
	}
}

func TestCreateTrustManager(t *testing.T) {
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	ik := "IK" + time.Now().Format(consttimeformat) + "KA"
	info := fmt.Sprintf(constinfo, time.Now().Second(), time.Now().Second())
	cRow1, err := RegisterClientByIK(ik, info, true)
	if err != nil {
		t.Logf(constregisterfailed, err)
	}
	defer DeleteClientByID(cRow1.ID)
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
	regtime := time.Time{}
	ik2 := "IK" + time.Now().Format(consttimeformat) + "KA"
	RegisterClientByID(deviceId, regtime, ik2)
	defer DeleteClientByID(deviceId)
	CreateTrustManager(constDB, constDNS)
	defer ReleaseTrustManager()
}
